function suijishu(a,b)
{
	var mynum=new Array(a);
	var obj=new Array(a);
	var kai=0;
	for (var i = 0, j = mynum.length; i < j; i++)
	{
	   mynum[i]=Math.ceil(Math.random()*b);//随机数
	   kai=0;//重置kai的值
	   //遍历obj数组,查看是否有重复的值,有则重新随机
	   for (var k = 0; k < j; k++)
	   {
		   //如果没有重复则kai加1
			if(obj[k]!=mynum[i]){ 
				kai++;
			}
			//如果kai再最大值还未随机到重复值,则赋值给obj
			if(kai==a){
				obj[i]=mynum[i];
			}
			//如果有重复的则i减1,重新随机
			if((kai<a)&&(k==(a-1))){
				i--;
			}
			//进行排序
			function sequence(a,b){
            return a - b;
        	}
			obj=obj.sort(sequence)
		}
	}
	return obj;
}
console.log(suijishu(6,33));
console.log(suijishu(1,16));


var rand = (function(){
  var today = new Date();
  var seed = today.getTime();
  function rnd(){
    seed = ( seed * 9301 + 49297 ) % 233280;
    return seed / ( 233280.0 );
  };
  return function rand(number){
    return Math.ceil(rnd(seed) * number);
  };
})();
 
console.log(rand(100))